<?php

define('ROOT_PATH', dirname(__FILE__));
include_once 'library/ModelCreator/Language/Selector.php';
include_once 'library/ModelCreator/Update/Detector.php';
$lang = new ModelCreator_Language_Selector();
$arrLang = $lang->detect();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/style.css" rel="stylesheet">
<link href="css/black-tie/jquery-ui-1.9.1.custom.css" rel="stylesheet">
<script src="js/jquery-1.8.3.js"></script>
<script src="js/jquery-ui-1.9.2.custom.js"></script>

<script src="js/functions.js"></script>
<script>
$(function() {
                //$( document ).tooltip();
		$( "#tabs" ).tabs();
                
		$( "#btnConnect").button({
                    icons: {
                    primary: "ui-icon-link"
                    }
		});
                
                var tooltips = $( "[title]" ).tooltip();
              $('#dialog-error-object').hide();   
              $('#dialogInstall').hide();
              $('#ajax-loader').hide(); 
              
              $('input[type=radio][value=mysql]').click(function(){
                 $('#schema').parent().hide();
              });
              
              $('input[type=radio][value=oracle]').click(function(){
                 if(!$('#schema').is(":visible")){
                    $('#schema').parent().show();
                 }
                 
              });
              
              $('input[type=radio][value=postgre]').click(function(){
                 if(!$('#schema').is(":visible")){
                    $('#schema').parent().show();
                 }
              });
              
            
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Model Creator</title>
</head>

<body>
<form id="frmData"> 
    
    <input type="hidden" name="language" value="<?php echo $arrLang['languageopt']; ?>"/>
    
<div id="main">
    <div id="tabs">
	<ul>
		<li><a href="#tabs-1"><?php echo $arrLang['connection']; ?></a></li>
		<li><a href="#tabs-2"><?php echo $arrLang['nomenclature']; ?></a></li>
		<li><a href="#tabs-3"><?php echo $arrLang['add']; ?></a></li>
        </ul>
	<div id="tabs-1">
            <fieldset>
                <legend><?php echo $arrLang['form_name']; ?>:</legend>
            <div>
                <label><?php echo $arrLang['sgbd']; ?></label>
                <p>
                    <input type="radio" name="connection[opt_sgbd]" value="oracle" checked="checked"> 
                        <img src="image/oracle.png" width="80px" height="15px" alt="oracle" title="Oracle" />
                    <input type="radio" name="connection[opt_sgbd]" value="mysql">
                        <img src="image/mysql.png" width="80px" height="50px" alt="mysql" title="MySQL" />
                    <input type="radio" name="connection[opt_sgbd]" value="postgre"> 
                        <img src="image/postgre.png" width="50px" height="50px" alt="postgre" title="Postgre" />
                </p>
            </div>
            <div>
                <label for="host"><?php echo $arrLang['host']; ?></label>
                <input type="text" class="input_text" name="connection[host]" id="host" title="<?php echo $arrLang['hosttitle'];?>"/>
            </div>
            <div>
                <label for="port"><?php echo $arrLang['port']; ?></label>
                <input type="text" class="input_text" name="connection[port]" id="port" maxlength="6" size="6" />
            </div>
             <div>
                <label for="user"><?php echo $arrLang['user']; ?></label>
                <input type="text" class="input_text" name="connection[user]" id="user"/>
            </div>
             <div>
                <label for="password"><?php echo $arrLang['password']; ?></label>
                <input type="text" class="input_text" name="connection[password]" id="password"/>
            </div>
             <div>
                <label for="database"><?php echo $arrLang['database']; ?></label>
                <input type="text" class="input_text" name="connection[database]" id="database"/>
            </div>
             <div>
                <label for="schema"><?php echo $arrLang['schema']; ?></label>
                <input type="text" class="input_text" name="connection[schema]" id="schema"/>
            </div>   
               
             <div>
                <label for="project"><?php echo $arrLang['project']; ?></label>
                <input type="text" class="input_text" name="connection[project]" id="project"/>
            </div>    
                
            </fieldset>
             </form>
        </div>
	<div id="tabs-2">
            
            <fieldset>
            <legend> <?php echo $arrLang['nomenclature']." ".$arrLang['file'].":" ;?></legend> 
           
            <div>
                <label for="pref_file"><?php echo $arrLang['prefix']; ?></label>
                <input type="text" class="input_text" name="nomenclature[pref_file]" id="pref_file" />
             </div> 
            <div>
                <label for="suf_file"><?php echo $arrLang['suffix']; ?></label>
                <input type="text" class="input_text" name="nomenclature[suf_file]" id="suf_file" />
            </div> 
           
            </fieldset>
            <fieldset>
            <legend> <?php echo $arrLang['nomenclature']." ".$arrLang['class'].":" ;?></legend> 
           
            <div>
                <label for="pref_class"><?php echo $arrLang['prefix']; ?></label>
                <input type="text" class="input_text" name="nomenclature[pref_class]" id="pref_class" />
             </div> 
            <div>
                <label for="suf_class"><?php echo $arrLang['suffix']; ?></label>
                <input type="text" class="input_text" name="nomenclature[suf_class]" id="suf_class" />
            </div> 
            
            
           
            </fieldset>
            
            <fieldset>
            <legend> <?php echo $arrLang['sequence'].":" ;?></legend> 
           
            <div>
                <label for="pref_seq"><?php echo $arrLang['prefix']; ?></label>
                <input type="text" class="input_text" name="nomenclature[pref_seq]" id="pref_seq"  />
             </div> 
            <div>
                <label for="suf_seq"><?php echo $arrLang['suffix']; ?></label>
                <input type="text" class="input_text" name="nomenclature[suf_seq]" id="suf_seq" title="Default: _seq" />
            </div> 
            <div>
                <label></label>    
                <input type="radio" name="nomenclature[opt_seq_name]" value="table_name" checked="checked"> <?php echo $arrLang['table']; ?>
                <input type="radio" name="nomenclature[opt_seq_key]" value="table_name"> <?php echo $arrLang['pkey']; ?>   
                    
           </div> 
            
           
            </fieldset>
            
           
            
        </div>
	<div id="tabs-3">
            <fieldset>
            <legend><?php echo $arrLang['information'].":"; ?></legend> 
            <div>
                <label for="organization"><?php echo $arrLang['organization']; ?></label>
                <input type="text" class="input_text" name="plus[organization]" id="organization" title="Default: MODEL CREATOR"/>
            </div> 
             <div>
                <label for="author"><?php echo $arrLang['author']; ?></label>
                <input type="text" class="input_text" name="plus[author]" id="author" title="Default: model.creator" />
            </div> 
             <div>
                <label for="extend"><?php echo $arrLang['extend']; ?></label>
                <input type="text" class="input_text" name="plus[extend]" id="extend" title="Default: Zend_Db_Table" />
            </div> 
             <div>
                <label for="package"><?php echo $arrLang['package']; ?></label>
                <input type="text" class="input_text" name="plus[package]" id="package" title="Default: Application" />
            </div> 
            <div>
                <label for="subpackage"><?php echo $arrLang['subpackage']; ?></label>
                <input type="text" class="input_text" name="plus[subpackage]" id="package" title="Default: Models" />
            </div> 
            </fieldset>
        </div>
        
        <div id="boxbutton" align="right">
            <button type="button" id="btnConnect"><?php echo $arrLang['connect']; ?></button>
        </div>
    </div>
</div>
    <!-- FILES -->
    <div id="dialog" title="<?php echo $arrLang['files']; ?>"></div>
    <!-- FILE CONTENT -->
    <div id="dialogContent"></div>
    <!-- AJAX LOADER -->
    <div id="ajax-loader" title="<?php echo $arrLang['loading']; ?>" align="center">
       <img src='image/ajax-loader.gif' style='padding-top: 20px' />
    </div>
    <!--DIALOG ERROR -->
    <div id="dialog-error" title="<?php echo $arrLang['connecterror']; ?>"></div>
    <!--DIALOG ERROR CREATE FILES -->
    <div id="dialog-error-object" title="<?php echo $arrLang['connecterror']; ?>">
        <div class='ui-widget'>
        <div class='ui-state-error ui-corner-all' style='padding: 0 .7em;'>   
        <p>
            <span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span>
            <strong><?php echo $arrLang['alert']; ?>:</strong> <?php echo $arrLang['msg_error_object']; ?></p>
        </div>
        </div>
    </div>
    
    <input type="hidden" id="btnCancel" value="<?php echo $arrLang['cancel']; ?>" />
    <input type="hidden" id="btnConfirm" value="<?php echo $arrLang['confirm']; ?>" />
    
</body>
</html>
